#pragma once

#define DIRECTINPUT_VERSION 0x0800
#define TEXTURE_SIZE 20
#define BUTTONSTATE_PRESSED TRUE
#define BUTTONSTATE_RELEASED FALSE
#define DINPUT_BUFFERSIZE 16
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_TEX1)

#pragma warning( disable : 4996 )
#pragma warning( disable : 4819 )
#pragma warning(disable  : 4995 )
#pragma warning( disable : 4996 )

#include "basicinfo.h"
#include <assert.h>
#include "comp_arch/Component.h"
#include "comp_arch/Object.h"
#include "comp_arch/ObjectManager.h"
#include "internal/pototype.h"

#include <d3d9.h>
#include <D3dx9core.h>
#include <strsafe.h>
#include <dinput.h>
#include <vector>
#include <string>

using namespace Cistron;
using namespace std;

enum GAME_STATE
{
	MENU,
	STORY,
	FIGHT,
	END
};

enum FIGHT_MENU
{
	MATTACK,
	MCOMSKILL,
	MGUARD,
	MMAGIC,
	MMOVE,
	MPROPS,
	NONE
};

enum FIGHT_STATE
{
	FBROSE,
	FMENU,
	FPREMOVE,
	FMOVE,
	FATTACK
};

struct WorldPoint
{
	int32 x;
	int32 y;

	bool operator == (WorldPoint & p)
	{
		return this->x==p.x&& this->y==p.y;
	}
};

struct CUSTOMVERTEX
{
	D3DXVECTOR3 position; // The position
	FLOAT tu, tv;   // The texture coordinates
};

struct FIG_POS
{
	int32 fid;
	int32 x;
	int32 y;
};

struct CAMERA_INFO
{
	float m_fovy;
	float m_aspect;
	float m_zn;
	float m_zf;
	D3DXMATRIX m_ViewMatrix;
	D3DXVECTOR3 m_position;
	D3DXVECTOR3 m_target;
	D3DXVECTOR3 m_up;
};

struct FIGURE_ABILITY
{
    int32 hp;
    int32 mp;
	int32 move;
};

enum _SYSTEM_MESSAGE
{
	MOUSE_LEFT_CLICKED,
	MOUSE_RIGHT_CLICKED,
	MOUSE_LEFT_DCLICKED,
	MOUSE_RIGHT_DCLICKED
};

enum FACE{N,NE,E,ES,S,SW,W,WN};

struct PCOLOR
{
	float a;
	float r;
	float g;
	float b;
};
